<include file="Common:header" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.all.js"> </script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
<style type="text/css">
    .edui-default{line-height:20px;}
    div.edui-combox-body,div.edui-button-body,div-edui-splitbutton-body{overflow:hidden;height:20px}
    div.edui-box{overflow:hidden;height:22px}
    .uploadify{display:inline-block;}
    .uploadify-button{border:none;border-radius:5px;margin-top:8px;}
    table.add_tab tr td span.uploadify-button-text{color:#FFF;margin:0;}
    #art_thumb_img{max-height: 130px;max-width: 500px;margin-top: 10px;}
</style>
</head>
<body>
<!--面包屑导航 开始-->
<div class="crumb_warp">
    <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
    <i class="fa fa-home"></i> <a href="{:U(MODULE_NAME.'/Index/info')}">首页</a> &raquo; 添加文章
</div>
<!--面包屑导航 结束-->

<!--结果集标题与导航组件 开始-->
<div class="result_wrap">
    <div class="result_title">
        <h3>快捷操作</h3>
    </div>
    <div class="result_content">
        <div class="short_wrap">
            <a href="{:U(MODULE_NAME.'/Singlepage/add')}"><i class="fa fa-plus"></i>添加单页</a>
            <a href="{:U(MODULE_NAME.'/Singlepage/index')}"><i class="fa fa-refresh"></i>刷新页面</a>
        </div>
    </div>
</div>
<!--结果集标题与导航组件 结束-->

<div class="result_wrap">
    <form action="{:U(MODULE_NAME.'/Singlepage/add')}" method="post">
        <table class="add_tab">
            <tbody>
            <tr>
                <th><i class="require">*</i>单页名称：</th>
                <td>
                    <input type="text" id="name" name="name">
                </td>
            </tr>
            <tr>
                <th>排序：</th>
                <td>
                    <input type="text" class="sm" name="sort" id="sort" value="0" >

                </td>
            </tr>

            <tr>
                <th><i class="require">*</i>单页内容：</th>
                <td>
                    <script id="editor" name="content" type="text/plain" style="width:850px;height:500px;"></script>
                </td>
            </tr>
            <tr>
                <th></th>
                <td>
                    <input type="submit" id="button" value="提交">
                    <input type="button" class="back" onclick="history.go(-1)" value="返回">
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>

<script type="text/javascript">
    //实例化编辑器
    var ue = UE.getEditor('editor', {
        //serverUrl: '/server/ueditor/controller.php'
    });
    $(function() {

        $("#button").click(function() {
            var name = $("#name").val();
            var content = $('textarea[name=content]').val();
            if(name == ''){
                layer.msg('单页名称不能为空！');
                $("#name").focus();
                return false;
            }
            if(content ==null ){
                layer.msg('单页内容不能为空！');
                return false;
            }
        });
    });
</script>
</body>
</html>